﻿package com.yy.mvc.view{
    import com.yy.base.YYSprite;
    
    import flash.display.*;

	/**
	 *游戏层次序 
	 * @author YY
	 * 
	 */
    public class AppContainer extends YYSprite {

        private var _appStage:Stage;
        private var _main:Sprite;//主程序
        public var sceneMouserEnabled:Boolean = true;
        private var _sceneLayer:YYSprite;//场景层
        private var _mouseEventLayer:YYSprite;//鼠标事件层
        private var _panelLayer:YYSprite;//面板 层
        private var _uiLayer:YYSprite;//ui层
        private var _tipLayer:YYSprite;//tooltips层
        private var _popupLayer:YYSprite;//弹框层
        private var _popupTipsLayer:YYSprite;
        private var _reserveLayer:YYSprite;//预留层
        private var _loadingLayer:YYSprite;//loading层
        private var _mouseLayer:YYSprite;//鼠标层

        public function init(stage:Stage, container:Sprite):void{
            this._appStage = stage;
            this._main = container;
            this._sceneLayer = new YYSprite();
            this._sceneLayer.mouseChildren = this.sceneMouserEnabled;
            this._sceneLayer.mouseEnabled = this.sceneMouserEnabled;
            stage.addChildAt(this.sceneLayer, 0);
            this._mouseEventLayer = new YYSprite();
            container.addChild(this._mouseEventLayer);
            this._panelLayer = new YYSprite();
            container.addChild(this._panelLayer);
            this._uiLayer = new YYSprite();
            container.addChild(this._uiLayer);
            this._tipLayer = new YYSprite();
            this._tipLayer.mouseEnabled = false;
            container.addChild(this._tipLayer);
            this._popupLayer = new YYSprite();
            container.addChild(this._popupLayer);
            this._popupTipsLayer = new YYSprite();
            container.addChild(this._popupTipsLayer);
            this._reserveLayer = new YYSprite();
            container.addChild(this._reserveLayer);
            this._loadingLayer = new YYSprite();
            container.addChild(this._loadingLayer);
            this._mouseLayer = new YYSprite();
            this._mouseLayer.mouseEnabled = false;
            container.addChild(this._mouseLayer);
        }
        public function get sceneLayer():YYSprite{
            return (this._sceneLayer);
        }
        public function get mouseEventLayer():YYSprite{
            return (this._mouseEventLayer);
        }
        public function get panelLayer():YYSprite{
            return (this._panelLayer);
        }
        public function get uiLayer():YYSprite{
            return (this._uiLayer);
        }
        public function get tipLayer():YYSprite{
            return (this._tipLayer);
        }
        public function get popupLayer():YYSprite{
            return (this._popupLayer);
        }
        public function get popupTipsLayer():YYSprite{
            return (this._popupTipsLayer);
        }
        public function get reserveLayer():YYSprite{
            return (this._reserveLayer);
        }
        public function get loadingLayer():YYSprite{
            return (this._loadingLayer);
        }
        public function get mouseLayer():YYSprite{
            return (this._mouseLayer);
        }

    }
}